\section{round --- Round off value}
\label{fn:round}
\index{round()}
\index{round off value}
\begin{rail}
Round : 'round' '(' ( Scalar | Matrix ) ')' ;
\end{rail}

\verb+round+ returns the nearest integer value to the argument.
If the argument is a matrix, the operation is done element by
element.

The returned value is somewhat dependant on the underlying 
math library function, though in general, if the difference
between the function argument and the rounded result is exactly
$0.5$, then the result will be rounded to the nearest even integer. 


\paragraph{Example}
\index{example of round()}
\index{round()!example}
\begin{verbatim}
> round(1.002)
        1
> round(1.998)
        2
> round(1.5)
        2
> round(2.5)
        2
> b = 100*rand(2,5)
 b =
     65.5         91       29.9         70       9.18  
     12.9       11.2       26.5         95       90.2  
> round(b)
       65         91         30         70          9  
       13         11         27         95         90  
> c = 100*(rand(2,3)+(rand(2,3)*(0+1j)))
 c =
 matrix columns 1 thru 3
              96 + 90.8i            44.1 + 14.8i           92.4 + 0.543i
            91.5 + 36.2i            7.35 + 87.9i            8.82 + 22.2i

> round(c)
 matrix columns 1 thru 3
                96 + 91i                44 + 15i                 92 + 1i
                91 + 36i                 7 + 88i                 9 + 22i
\end{verbatim}

See also: Page~\pageref{fn:ceil} \verb+ceil()+,
Page~\pageref{fn:floor} \verb+floor()+,
Page~\pageref{fn:int} \verb+int()+.


\newpage



